#define _CRT_SECURE_NO_WARNINGS 1
#include <string.h>
int ch(char* c, int n, int j) {
    int i;

    for (i = j; i < n; i++) {
        if (c[i] == c[n])
            return 1;
    }
    return 0;
}
int lengthOfLongestSubstring(char* s) {
    int len = strlen(s);
    int i, j = 0;
    int m = 0, n = 0;
    for (i = 0; i < len; i++) {

        if (ch(s, i, j) == 0) {
            n++;
        }
        else {
            i = ++j;
            i--;
            n = 0;
        }
        if (n > m) {
            m = n;
        }
    }
    return m;
}